//
//  NSMutableAttributedString+ZJHelperKit.m
//  Teecloud
//
//  Created by 小熊 on 2018/9/10.
//  Copyright © 2018年 小志. All rights reserved.
//

#import "NSMutableAttributedString+ZJHelperKit.h"

@implementation NSMutableAttributedString (ZJHelperKit)
/**设置价钱的大小字体*/
+(NSMutableAttributedString *)String:(NSString *)String RangeString:(NSString *)RangeString{
    NSMutableAttributedString *hintString=[[NSMutableAttributedString alloc]initWithString:String];
    //获取要调整颜色的文字位置,调整颜色
    NSRange range1=[[hintString string]rangeOfString:RangeString];
    [hintString addAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#FF8D00"],NSFontAttributeName:[UIFont systemFontOfSize:12]} range:range1];
    return hintString;
}

/**给旧价钱添加中划线*/
+(NSMutableAttributedString *)setOldString:(NSString *)String{
    //中划线
    NSDictionary *attribtDic = @{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]};
    NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc]initWithString:String attributes:attribtDic];
    return attribtStr;
}
@end
